#ifndef GSTPLAYER_H
#define GSTPLAYER_H

#include <gst/gst.h>
#include <stdlib.h>
#include <portaudio.h>
#include <queue>

typedef struct _CustomData{
    GstElement *pipeline;
    GstElement *source;
    GstElement *decoder;
    GstElement *sink;
    GstElement *playbin;
    GMainLoop *main_loop;
}CustomData;

class GstPlayer
{
public:
    GstPlayer(int argc, char *argv[]);
    ~GstPlayer();
    void start(const char* filepath);
    void init(int argc, char *argv[]);
    void hello(GstState state);
    void Control(const char *filepath);

private:

    GstBus *bus;
    CustomData data;
    static gboolean handle_message(GstBus *bus, GstMessage *msg,CustomData *data);
    void _start(const char *filepath, CustomData data);

};



#endif // GSTPLAYER_H
